namespace GemBox.Spreadsheet
{
    using System;
    using System.Collections;

    internal class UnaryOperatorFormulaToken : FormulaToken
    {
        public static readonly Hashtable CodesToStrings = new Hashtable();
        public static readonly ArrayList UnaryOperatorsList = new ArrayList();

        static UnaryOperatorFormulaToken()
        {
            CodesToStrings[FormulaTokenCode.Uplus] = "+";
            CodesToStrings[FormulaTokenCode.Uminus] = "-";
            CodesToStrings[FormulaTokenCode.Percent] = "%";
            CodesToStrings[FormulaTokenCode.Parentheses] = "(";
            UnaryOperatorsList.AddRange(new char[] { '+', '-', '%', '(', ')' });
        }

        public UnaryOperatorFormulaToken(FormulaTokenCode code) : base(code, 1, FormulaTokenType.Unary)
        {
        }

        public override string ToString()
        {
            return (CodesToStrings[(FormulaTokenCode) base.Code] as string);
        }
    }
}
